package org.example.erpapiservicespringmongoimpl.mapper;

import org.example.erpapicommon.model.TProduct;
import org.example.erpapiservicespringmongoimpl.doc.ProductDoc;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Named;

import java.util.List;
@Mapper(componentModel = "spring",uses = {CategoryMapper.class, SupplierMapper.class})
public interface ProductPageMapper {
    @Mapping(source = "category.level3.id", target = "categoryId")
    @Mapping(source = "category.level3.name", target = "categoryName")
    TProduct fromDocToT(ProductDoc product);

    List<TProduct> fromDocsToTProducts(List<ProductDoc> productDocs);
}
